<div class="modal" id="my-modal">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal">×</button>
		<h3>Chi tiết đơn hàng <strong>#<?php echo $order->order_number?></strong></h3>
	</div>
	<div class="modal-body">
    	<?php if(!empty($cart)){?>
        	<table class="table table-striped table-bordered">
            	<thead>
                	<tr>
                    	<td> SKU 	</td>
                        <td> Tên 	</td>
                        <td> Giá 	</td>
                        <td> Số lượng </td>
                        <td> Tổng cộng</td>
                    </tr>
                </thead>
                <tbody>
                	<?php foreach($cart as $item){?>
                		<tr>
                    		<td> <?php echo $item["sku"]?> </td>
                            <td> <a href="<?php echo site_url($category_name[$item["id"]]."/".$item["slug"])?>"> <?php echo $item["name"]?> </a></td>
                            <td> <?php echo format_currency($item['price']);?></td>
                            <td> <?php echo $item['quantity'];?></td>
                            <td> <?php echo format_currency($item['subtotal']);?></td>
                    	</tr>
                    <?php }?>
                </tbody>
                <tfoot>
                	<?php $data_price = (array)json_decode($order->history);//echo "<pre>";print_r($data_price);print_r($order);?>
                	<?php if($data_price["group_discount"] > 0)  : ?> 
                    <tr>
                        <td colspan="4"><strong><?php echo lang('group_discount');?></strong></td>
                        <td>-<?php echo format_currency($data_price["group_discount"]); ?></td>
                    </tr>
                    <?php endif; ?>
                    <tr>
                        <td colspan="4"><strong><?php echo lang('subtotal');?></strong></td>
                        <td id="gc_subtotal_price"><?php echo format_currency($data_price["cart_subtotal"]); ?></td>
                    </tr>
					<?php if($data_price["coupon_discount"] > 0) {?>
                    <tr>
                        <td colspan="4"><strong><?php echo lang('coupon_discount');?></strong></td>
                        <td id="gc_coupon_discount">-<?php echo format_currency($data_price["coupon_discount"]);?></td>
                    </tr>
					<?php if($data_price["tax"] != 0) { // Only show a discount subtotal if we still have taxes to add (to show what the tax is calculated from)?> 
                    <tr>
                        <td colspan="4"><strong><?php echo lang('discounted_subtotal');?></strong></td>
                        <td id="gc_coupon_discount"><?php echo format_currency($data["cp_discounted_subtotal"]);?></td>
                    </tr>
                    <?php }} ?>
                    <?php $charges = $data_price["custom_charges"];
					if(!empty($charges))
					{ foreach($charges as $name=>$price) : ?>
					<tr>
						<td colspan="4"><strong><?php echo $name?></strong></td>
						<td><?php echo format_currency($price); ?></td>
					</tr>	
					<?php endforeach;}?>
                    <?php if($data_price["shipping"] -> price > 0) : ?>
                    <tr>
                   		<td colspan="4"><strong><?php echo lang('shipping');?></strong></td>
                    	<td><?php echo format_currency($data_price['shipping']->price); ?></td>
               		</tr>
                	<?php endif; ?>
                    <?php if($data_price["tax"] > 0) :  ?>
                    <tr>
                        <td colspan="4"><strong><?php echo lang('tax');?></strong></td>
                        <td><?php echo format_currency($data_price["tax"]);?></td>
                    </tr>
					<?php endif; ?>
					<?php
						/**************************************************************
						Gift Cards
						**************************************************************/
					if(!empty($data["gift_card_discount"]) && $data["gift_card_discount"] > 0) : ?>
					<tr>
						<td colspan="4"><strong><?php echo lang('gift_card_discount');?></strong></td>
						<td>-<?php echo format_currency($data["gift_card_discount"]); ?></td>
					</tr>
					<?php endif; ?>
                    <?php if(!empty($data_price["score_customer"]->total_score_minus) && $data_price["score_customer"]->total_score_minus != 0):?>
                    <tr>
                        <td colspan="4"><strong>Số điểm bị trừ <?php echo $data_price["score_customer"]->total_score_minus ?> điểm, qui đổi ra tiền  </strong></td>
                        <td>-<?php echo format_currency($data_price["score_customer"]->total_price_score); ?></td>
                    </tr>
                    <?php endif; ?>
                    <tr>
                        <td colspan="4"><strong><?php echo lang('grand_total');?></strong></td>
                        <td><?php echo format_currency($order->total); ?></td>
                    </tr>
				</tfoot>
            </table>
        <?php }else{
			echo "<p> Đơn hàng hiện tại đang xảy ra lỗi. Vui lòng quay lại sau</p>";	
		}?>
	</div>
	<div class="modal-footer">
	
	</div>
</div>